import { httpDelete, httpGet, httpPost, httpPut } from "@/utils/http";


export function addAdminApi(data: object) {
    return httpPost('/admin/add', data);
}
export function getAdminApi(data?: object) {
    return httpPost('/admin/find', data);
}
export function updateAdminApi(data: object) {
    return httpPut('/admin/update', data);
}
export function deleteAdminApi(data: object) {
    return httpDelete('/admin/remove', data);
}
export function getAdminByIdApi(data?: object) {
    return httpGet('/admin/getById', data);
}
export function adminLoginApi(data: { account: string, password: string }) {
    return httpPost('/admin/login', data);
}
// 获取管理员详情（管理员信息、权限信息）
export function getLoginInfoApi() {
    // 该请求的参数，需要在 axiosConfig.ts 文件中通过【请求拦截器】，给请求头添加参数传递
    return httpGet('/admin/getByToken');
}